package kr.hkit.powerjava.chapter20;

import java.util.StringTokenizer;

public class StringTokenizerEx {

	public static void main(String[] args) {
		
		StringTokenizer st0 = new StringTokenizer("1 2 3 4 5");
		System.out.println("토큰의 수: " + st0.countTokens());
		while(st0.hasMoreElements()){
			System.out.print(st0.nextToken());
		}
		System.out.println();
		
		StringTokenizer st = new StringTokenizer("1, 2, 3, 4, 5", ", ");
		while(st.hasMoreElements()){
			System.out.print(st.nextToken());
		}
		System.out.println();
		
		StringTokenizer st2 = new StringTokenizer("1, 2, 3, 4, 5", ", ", true);
		while(st2.hasMoreElements()){
			System.out.print(st2.nextToken());
		}
	}
}
